﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel.DataAnnotations;

namespace ROOTFileSizeAnalyzer
{
    /// <summary>
    /// Simple class tha contains all the ROOT info we could wish for.
    /// </summary>
    public class ROOTBranchInfo
    {
        [Display(Name="Branch Number", ShortName="Branch", Description="The TTree branch number (index in the list of branchs in the TTree)")]
        public int BranchNumber { get; set; }

        [Display(Name="Branch Name", ShortName="Name")]
        public string BranchName { get; set; }

        [Display(Name="Branch Data Type", ShortName="Type")] 
        public string BranchType { get; set; }

        [Display(Name="Entries")]
        public int Entries { get; set; }

        [Display(Name="Size in Memory", ShortName="Size")]
        public long TotalSize { get; set; }

        [Display(Name="Size on Disk")]
        public long TotalSizeOnDisk { get; set; }

        [Display(Name="Number of Baskets", ShortName="# Baskets")]
        public int NumberBaskets { get; set; }

        [Display(Name="Basket Size")]
        public int BasketSize { get; set; }

        [Display(Name="Compression Factor")]
        public double CompressionFactor { get; set; }

        [Display(Name="Size in Memory per Entry", ShortName="Size/Entry")]
        public double TotalSizePerEntry
        {
            get { if (Entries != 0) return TotalSize / Entries; return 0; }
        }

        [Display(Name = "Size on Disk per Entry", ShortName = "Disk Size/Entry")]
        public double SizeOnDiskPerEntry
        {
            get { if (Entries != 0) return TotalSizeOnDisk / Entries; return 0; }
        }
    }
}
